package com.xca.znb.model.impl;

import android.content.Context;

import com.xca.znb.database.UserDAO;
import com.xca.znb.model.imodel.UserAuthModel;

public class UserAuthModelImpl implements UserAuthModel {
    private UserDAO userDAO;

    public UserAuthModelImpl(Context context) {
        userDAO = new UserDAO(context);
    }

    @Override
    public boolean isUserExists(String phone) {
        return userDAO.isUserExists(phone);
    }

    @Override
    public boolean isValidPassword(String phone, String password) {
        return userDAO.isValidPassword(phone, password);
    }

    @Override
    public void addUser(String phone, String password) {
        userDAO.addUser(phone, password);
    }

    @Override
    public void addAccount(String phone, double num, String type, String time_day, String time_sec) {
        userDAO.insertAccount(phone, num, type, time_day, time_sec);
    }

}
